<?php

namespace services\baibai;

use Yii;
use common\models\baibai\Model;
use common\components\Service;

/**
 * Class ConfigService
 * @package services\patient
 */
class ConfigService extends Service
{
    // 大部位映射配置   白白管家 => bm_body_large / bm_body_relation   白友 => by_base_body_parts
    const LARGE_BODY_PARTS = [
        0 => 0,
        1 => 162,// 头部
        2 => 168,// 额部
        3 => 172,// 眼周
        4 => 179,// 眉周
        5 => 54,// 鼻部
        6 => 33,// 耳周
        7 => 44,// 口周
        8 => 201,// 下巴
        9 => 64,// 颈部
        10 => 64,// 肩部
        11 => 205,// 胸部
        12 => 213,// 上腹部
        13 => 220,// 下腹部
        14 => 226,// 手臂
        15 => 233,// 手部
        16 => 157,// 后背
        17 => 259,// 后腰
        18 => 264,// 会阴部（女）
        19 => 271,// 会阴部（男）
        20 => 105,// 臀部
        21 => 276,// 腿部
        22 => 297,// 脚部
        23 => 307,// 腋下
        24 => 308,// 肛周
        25 => 156,// 前胸
        26 => 306,// 胯部
        27 => 11,// 面部
    ];

    // 小部位映射配置   白白管家 => bm_body_small / bm_body_relation   白友 => by_base_body_parts
    const SMALL_BODY_PARTS = [
        0 => 0,
        1 => 277, // 左小腿前
        2 => 290, // 左小腿后
        3 => 163, // 左眉下
        4 => 181, // 右眉下
        5 => 0, // 左前额
        6 => 171, // 左额部
        7 => 175, // 左眼外眦
        8 => 178, // 右眼内眦
        9 => 176, // 左眼内眦
        10 => 180, // 左眉上
        11 => 183, //右眉上
        12 => 170, //右额部
        13 => 169, //额中
        14 => 173, //右眼外眦
        15 => 25, //左眼皮
        16 => 26, //右眼皮
        17 => 177, //左眼下
        18 => 174, //右眼下
        19 => 185, //左眉头
        20 => 186, //右眉头
        21 => 184, //左眉尾
        22 => 182, //右眉尾
        23 => 59, //鼻梁
        24 => 187, //左鼻孔
        25 => 189, //右鼻孔
        26 => 191, //左鼻翼
        27 => 190, //右鼻翼
        28 => 188, //鼻中隔
        29 => 39, //左耳前
        30 => 40, //右耳前
        31 => 42, //左耳后
        32 => 43, //右耳后
        33 => 192, //左耳廓
        34 => 195, //右耳廓
        35 => 194, //左耳道
        36 => 196, //右耳道
        37 => 193, //左耳垂
        38 => 197, //右耳垂
        39 => 48, //上唇
        40 => 49, //下唇
        41 => 200, //上唇面
        42 => 199, //下唇面
        43 => 198, //人中
        44 => 51, //左口角
        45 => 52, //右口角
        46 => 67, //颈前
        47 => 66, //颈后
        48 => 203, //颈左侧
        49 => 204, //颈右侧
        50 => 71, //左肩
        51 => 72, //右肩
        52 => 212, //左乳房
        53 => 207, //左乳晕
        54 => 208, //右乳房
        55 => 209, //右乳晕
        56 => 211, //剑突
        57 => 206, //左腋下
        58 => 210, //右腋下
        59 => 215, //左肋前
        60 => 214, //右肋前
        61 => 217, //左肋侧
        62 => 219, //右肋侧
        63 => 216, //腹正中
        64 => 222, //左胯
        65 => 225, //右胯
        66 => 223, //脐周
        67 => 221, //左腹股沟
        68 => 224, //右腹股沟
        69 => 230, //左前臂
        70 => 229, //左后壁
        71 => 231, //左手肘
        72 => 232, //右前臂
        73 => 227, //右后臂
        74 => 228, //右手肘
        75 => 248, //左手掌
        76 => 236, //左手背
        77 => 250, //左大鱼际
        78 => 249, //左小鱼际
        79 => 243, //左手腕
        80 => 242, //左大拇指
        81 => 241, //左食指
        82 => 251, //左中指
        83 => 235, //左无名指
        84 => 234, //左小拇指
        85 => 237, //左指缝
        86 => 244, //右手掌
        87 => 252, //右手背
        88 => 253, //右大鱼际
        89 => 245, //右小鱼际
        90 => 238, //右手腕
        91 => 240, //右指缝
        92 => 254, //右大拇指
        93 => 246, //右食指
        94 => 247, //右中指
        95 => 239, //右无名指
        96 => 255, //右小拇指
        97 => 258, //左肩胛
        98 => 257, //右肩胛
        99 => 256, //背正中
        100 => 261, //左腰
        101 => 263, //右腰
        102 => 262, //腰正中
        103 => 260, //腰骶部
        104 => 268, //阴阜
        105 => 266, //左侧大阴唇
        106 => 265, //右侧大阴唇
        107 => 267, //左侧小阴唇
        108 => 270, //右侧小阴唇
        109 => 269, //阴道下
        110 => 273, //阴茎
        111 => 275, //阴囊
        112 => 274, //龟头
        113 => 272, //阴囊下
        114 => 108, //左臀
        115 => 109, // 右臀
        116 => 111, // 肛周
        117 => 289, // 左小腿内侧
        118 => 283, // 左小腿外侧
        119 => 296, // 右小腿前
        120 => 282, // 右小腿后
        121 => 292, // 右小腿内侧
        122 => 279, // 右小腿外侧
        123 => 295, // 左膝
        124 => 285, // 右膝
        125 => 286, // 左腘窝
        126 => 288, // 右腘窝
        127 => 278, // 左大腿前
        128 => 293, // 左大腿后
        129 => 281, // 左大腿内侧
        130 => 276, // 左大腿外侧
        131 => 280, // 右大腿前
        132 => 294, // 右大腿后
        133 => 284, // 右大腿外侧
        134 => 287, // 右大腿内侧
        135 => 303, // 左脚背
        136 => 305, // 左脚掌
        137 => 304, // 左脚后跟
        138 => 298, // 左脚趾
        139 => 302, // 右脚背
        140 => 301, // 右脚掌
        141 => 300, // 右脚后跟
        142 => 299, // 右脚趾
        143 => 167, // 左侧
        144 => 164, // 右侧
        145 => 166, // 前部
        146 => 165, // 后部
        147 => 202, // 下巴
        148 => 0, // 左面颊
        149 => 0, // 右面颊
        150 => 218, // 肋部
    ];

    // 人员   白白管家 => bm_user   白友 => by_member
    const MEMBER = [
        88 => 364,// 孙萍
        150 => 365,// 毛领娟
        97 => 366,// 龚迅
        881 => 367,// 吴静
        108 => 0,// 璩霞
        1 => 0,// admin
        109 => 0,// 罗建忠
        142 => 386,// 王飞南
        348 => 389,// 李晓伟
        660 => 391,// 郑睿娴
        351 => 0,// zhl
        572 => 390,// 钱思音
        665 => 393,// 游琪琪
        710 => 394,// 刘强
        659 => 0,// 苏苏
        154 => 387,// 郭中娟
        897 => 397,// 周兰付
        896 => 398,// 汪家妍
        953 => 401,// 梁萱 ? 梁轩
        939 => 399,// 杨海修
        1003 => 400,// 陶星星
        954 => 0,// 高冰
        /*710 => 395,// 杨勇盼
        710 => 396,// 吴静*/
    ];

    // 治疗室   白白管家 => bm_consultroom_config   白友 => by_clinic_treatment_room
    const TREATMENT_ROOM = [
        3 => 86,// 熏蒸治疗室
        4 => 85,// CO2点阵激光室
        5 => 84,// 纳晶微针治疗室
        6 => 83,// 全/半舱紫外线光疗室
        7 => 82,// 3 0 8 准分子激光室
        12 => 81,// 中药雾化治疗室
        14 => 80,// 希格玛小光疗机
        16 => 79,// 留观
    ];

    // 治疗项目   白白管家 => bm_item   白友 => by_clinic_project
    const CLINIC_PROJECT = [
        'id' => [
            1 => 218,// 中药熏蒸治疗
            2 => 219,// 点阵激光
            3 => 220,// 纳米微针药导
            4 => 222,// 全舱311紫外线治疗仪
            5 => 221,// 半舱311紫外线治疗仪
            6 => 223,// 308准分子激光
            7 => 225,// 希格玛小光疗机
            10 => 258,// 静脉注射
            11 => 259,// 观察费
            12 => 224,// 中药雾化治疗
            13 => 226,// 希格玛光疗机
            14 => 227,// 希格玛小光疗机（优惠）
            15 => 228,// 小光疗单管
            16 => 257,// 科诺单管光疗仪
            17 => 256,// 科诺聚焦光疗仪
            18 => 255,// 科诺双管光疗仪
            19 => 254,// 家用伍德灯
            20 => 253,// 上海西格玛单管光疗仪
            21 => 252,// 科诺聚焦光疗仪1
            22 => 230,// 普通床位
            23 => 229,// 护理费
            24 => 251,// 透气免洗粉色隔离液
            25 => 250,// 百颜汇隔离防晒乳
            26 => 249,// 植肤秀
            27 => 248,// 外用中药液
        ],
        'name' => [
            1 => '中药熏蒸治疗',
            2 => '点阵激光',
            3 => '纳米微针药导',
            4 => '全舱311紫外线治疗仪',
            5 => '半舱311紫外线治疗仪',
            6 => '308准分子激光',
            7 => '希格玛小光疗机',
            10 => '静脉注射',
            11 => '观察费',
            12 => '中药雾化治疗',
            13 => '希格玛光疗机',
            14 => '希格玛小光疗机（优惠）',
            15 => '小光疗单管',
            16 => '科诺单管光疗仪',
            17 => '科诺聚焦光疗仪',
            18 => '科诺双管光疗仪',
            19 => '家用伍德灯',
            20 => '上海西格玛单管光疗仪',
            21 => '科诺聚焦光疗仪1',
            22 => '普通床位',
            23 => '护理费',
            24 => '透气免洗粉色隔离液',
            25 => '百颜汇隔离防晒乳',
            26 => '植肤秀',
            27 => '外用中药液',
        ]
    ];

    // 诊室 白友
    const CLINIC = [
        'id' => 50,
        'name' => '门诊部'
    ];

    // 病种 白白管家 => bm_disease   白友 => by_patient_diseases
    const DISEASE = [
        1 => 1,// 白癜风
        2 => 2,// 白斑待查
        3 => 29,// 白色糠疹
        4 => 46,// 特异性白斑
        5 => 47,// 其他
        6 => 48,// 色素脱失斑
        7 => 6,// 无色素痣
    ];

    /**
     * ======================================= 导出数据配置 ==================================
     **/

    // 患者
    const PATIENT_ID = 1;

    // 导医
    const MEDICAL_ID = 2;

    // 消费
    const CONSUMPTION_ID = 3;

    // 治疗
    const TREATMENT_ID = 4;

    // 回访
    const CALLBACK_ID = 5;

    // 通用
    const GENERAL_ID = 6;

    // 模块列表
    const MUDLE_LIST = [
        [
            'id' => self::PATIENT_ID,
            'name' => '患者'
        ],
        [
            'id' => self::MEDICAL_ID,
            'name' => '导医'
        ],
        [
            'id' => self::CONSUMPTION_ID,
            'name' => '消费'
        ],
        [
            'id' => self::TREATMENT_ID,
            'name' => '治疗'
        ],
        [
            'id' => self::CALLBACK_ID,
            'name' => '回访'
        ],
        [
            'id' => self::GENERAL_ID,
            'name' => '通用'
        ]
    ];

    // 数据导出字段初始定义
    const NAME_ID = 1;// 姓名
    const GENDER_ID = 2;// 性别
    const AGE_ID = 3;// 年龄
    const BELONG_ASSISTANT_ID = 4;// 医助归属人
    const BELONG_MEMBER_ID = 5;// 客服归属人
    const PATIENT_CARD_ID = 6;// 诊疗号
    const CLINIC_ID = 7;// 诊室
    const LAST_REVISITING_ID = 8;// 上次到诊
    const NEXT_REVISITING_ID = 9;// 下次复诊
    const KF_LAST_CALLBACK_ID = 10;// 客服上次回访时间
    const YZ_LAST_CALLBACK_ID = 11;// 医助上次回访时间
    const KF_NEXT_CALLBACK_ID = 12;// 客服下次回访时间
    const YZ_NEXT_CALLBACK_ID = 13;// 医助下次回访时间
    const OUTPATIENT_TYPE_ID = 14;// 就诊类型
    const TAGS_ID = 15;// 患者标签
    const VISITS_ID = 16;// 复诊次数
    const MISSED_DAYS_ID = 17;// 未到诊天数
    const CALLBACK_COUNT_ID = 18;// 回访次数
    const CITY_NAME_ID = 19;// 地区
    const SOURCE_CHANNEL_ID = 20;// 来源
    const REMARK_ID = 21;// 备注
    const MOBILE_ID = 22;// 电话
    const PATIENT_DISEASES_ID = 23;// 病种
    const PATIENT_CHILD_DISEASES_ID = 50; // 二级病种
    const CALLBACK_CONTENT_ID = 24;// 最近一次回访内容
    const KF_LAST_CALLBACK_USER_ID = 25;// 客服上次回访人
    const YZ_LAST_CALLBACK_USER_ID = 26;// 医助上次回访人
    const MONEY_TIME_ID = 27;// 收费/退费时间
    const DOCTOR_NAME_ID = 28;// 医生
    const PRE_REALITY_ID = 29;// 应收/退金额
    const REALITY_ID = 30;// 实收/退金额
    const CLINIC_PROJECT_NAME_ID = 31;// 最近治疗项目
    const RECENTLY_CLINIC_ID = 32;// 最近治疗时间
    const OPERATE_NAME_ID = 33;// 操作人
    const TRADE_TYPE_ID = 34;// 交易类型
    // 追加的治療模塊字段id
    const TOTAL_NUM = 35;// 本次正常数量剩余
    const HELP_NUM = 36;// 本次援助数量剩余
    const RECENTLY_CLINIC_NUM = 37;// 本次治疗/新增/退费 - 正常数量
    const RECENTLY_SURPLUS_NUM = 38;// 本次治疗/新增/退费 - 援助数量
    const TOTAL_HELP_NUM = 39;// 本次正常数量剩余 + 本次援助数量剩余
    const CLINIC_SURPLUS_NUM = 40;// 本次治疗/新增/退费 - 正常数量 + 本次治疗/新增/退费 - 援助数量
    // 追加的患者导出项
    const CLINIC_TOTAL_NUM = 41;// 治疗数量（总计:正常+援助）
    const SY_CLINIC_TOTAL_NUM = 42;// 剩余治疗数量（总计:正常+援助）

    // 通用导出追加
    const REG_TIME = 43; // 挂号时间
    const FAULT_DIAGNOSIS_COUNT = 44; // 断诊次数
    const ALL_MONEY = 45; // 消费总额
    const TREAT_308 = 46; // 308治疗数
    const BUY_308 = 47; // 308 购买
    const SURPLUS_308 = 48; // 308剩余数量
    const IN_HOSPITAL_COUNT = 49; // 住院次数
    const CALLBACK_MEMBER_NAME = 51; // 最近一次回访人
    const CALLBACK_CONTENT = 52; // 最近一次回访内容
    const CALLBACK_TIME = 53; // 最近一次回访时间
    // 数据导出字段列表
    const MUDEL_LIST_FIELD = [
        self::PATIENT_ID => [
            [
                'id' => self::NAME_ID,
                'name' => '姓名'
            ],
            [
                'id' => self::GENDER_ID,
                'name' => '性别'
            ],
            [
                'id' => self::AGE_ID,
                'name' => '年龄'
            ],
            [
                'id' => self::BELONG_ASSISTANT_ID,
                'name' => '医助归属人'
            ],
            [
                'id' => self::BELONG_MEMBER_ID,
                'name' => '客服归属人'
            ], [
                'id' => self::PATIENT_CARD_ID,
                'name' => '诊疗号'
            ],
            [
                'id' => self::CLINIC_ID,
                'name' => '诊室'
            ],
            [
                'id' => self::PATIENT_DISEASES_ID,
                'name' => '病种'
            ],
            [
                'id' => self::CLINIC_PROJECT_NAME_ID,
                'name' => '治疗项目'
            ],
            [
                'id' => self::CLINIC_TOTAL_NUM,
                'name' => '治疗数量（总计）'
            ],
            [
                'id' => self::RECENTLY_CLINIC_NUM,
                'name' => '治疗数量（正常）'
            ],
            [
                'id' => self::RECENTLY_SURPLUS_NUM,
                'name' => '治疗数量（援助）'
            ],
            [
                'id' => self::SY_CLINIC_TOTAL_NUM,
                'name' => '剩余治疗数量（总计）'
            ],
            [
                'id' => self::TOTAL_NUM,
                'name' => '剩余治疗数量（正常）'
            ],
            [
                'id' => self::HELP_NUM,
                'name' => '剩余治疗数量（援助）'
            ],
            [
                'id' => self::LAST_REVISITING_ID,
                'name' => '上次到诊'
            ],
            [
                'id' => self::NEXT_REVISITING_ID,
                'name' => '下次复诊'
            ],
            [
                'id' => self::KF_LAST_CALLBACK_ID,
                'name' => '客服上次回访时间'
            ],
            [
                'id' => self::YZ_LAST_CALLBACK_ID,
                'name' => '医助上次回访时间'
            ],
            [
                'id' => self::KF_NEXT_CALLBACK_ID,
                'name' => '客服下次回访时间'
            ],
            [
                'id' => self::YZ_NEXT_CALLBACK_ID,
                'name' => '医助下次回访时间'
            ],
            [
                'id' => self::OUTPATIENT_TYPE_ID,
                'name' => '就诊类型'
            ],
            [
                'id' => self::TAGS_ID,
                'name' => '患者标签'
            ],
            [
                'id' => self::VISITS_ID,
                'name' => '复诊次数'
            ],
            [
                'id' => self::MISSED_DAYS_ID,
                'name' => '未到诊天数'
            ],
            [
                'id' => self::CALLBACK_COUNT_ID,
                'name' => '回访次数'
            ],
            [
                'id' => self::CITY_NAME_ID,
                'name' => '地区'
            ],
            [
                'id' => self::SOURCE_CHANNEL_ID,
                'name' => '来源'
            ],
            [
                'id' => self::REMARK_ID,
                'name' => '备注'
            ],
        ],
        self::MEDICAL_ID => [
            [
                'id' => self::NAME_ID,
                'name' => '姓名'
            ],
            [
                'id' => self::GENDER_ID,
                'name' => '性别'
            ],
            [
                'id' => self::AGE_ID,
                'name' => '年龄'
            ],
            [
                'id' => self::PATIENT_CARD_ID,
                'name' => '诊疗号'
            ],
            [
                'id' => self::CLINIC_ID,
                'name' => '诊室'
            ],
            [
                'id' => self::LAST_REVISITING_ID,
                'name' => '到诊时间'
            ],
            [
                'id' => self::MOBILE_ID,
                'name' => '电话'
            ],
            [
                'id' => self::CITY_NAME_ID,
                'name' => '地区'
            ],
            [
                'id' => self::PATIENT_DISEASES_ID,
                'name' => '病种'
            ],
            [
                'id' => self::SOURCE_CHANNEL_ID,
                'name' => '来源'
            ],
            [
                'id' => self::REMARK_ID,
                'name' => '备注'
            ],
        ],
        self::CALLBACK_ID => [
            [
                'id' => self::NAME_ID,
                'name' => '姓名'
            ],
            [
                'id' => self::GENDER_ID,
                'name' => '性别'
            ],
            [
                'id' => self::AGE_ID,
                'name' => '年龄'
            ],
            [
                'id' => self::PATIENT_CARD_ID,
                'name' => '诊疗号'
            ],
            [
                'id' => self::LAST_REVISITING_ID,
                'name' => '上次到诊'
            ],
            [
                'id' => self::MISSED_DAYS_ID,
                'name' => '未到诊天数'
            ],
            [
                'id' => self::NEXT_REVISITING_ID,
                'name' => '下次复诊'
            ],
            [
                'id' => self::VISITS_ID,
                'name' => '复诊次数'
            ],
            [
                'id' => self::KF_LAST_CALLBACK_ID,
                'name' => '客服上次回访时间'
            ],
            [
                'id' => self::YZ_LAST_CALLBACK_ID,
                'name' => '医助上次回访时间'
            ],
            [
                'id' => self::KF_NEXT_CALLBACK_ID,
                'name' => '客服下次回访时间'
            ],
            [
                'id' => self::YZ_NEXT_CALLBACK_ID,
                'name' => '医助下次回访时间'
            ],
            [
                'id' => self::CALLBACK_CONTENT_ID,
                'name' => '最近一次回访内容'
            ],
            [
                'id' => self::TAGS_ID,
                'name' => '患者标签'
            ],
            [
                'id' => self::OUTPATIENT_TYPE_ID,
                'name' => '就诊类型'
            ],
            [
                'id' => self::CITY_NAME_ID,
                'name' => '地区'
            ],
            [
                'id' => self::SOURCE_CHANNEL_ID,
                'name' => '来源'
            ],
            [
                'id' => self::REMARK_ID,
                'name' => '备注'
            ],
            [
                'id' => self::KF_LAST_CALLBACK_USER_ID,
                'name' => '客服上次回访人'
            ],
            [
                'id' => self::YZ_LAST_CALLBACK_USER_ID,
                'name' => '医助上次回访人'
            ], [
                'id' => self::CLINIC_ID,
                'name' => '诊室'
            ],
            [
                'id' => self::BELONG_ASSISTANT_ID,
                'name' => '医助归属人'
            ],
            [
                'id' => self::BELONG_MEMBER_ID,
                'name' => '客服归属人'
            ],
        ],
        self::CONSUMPTION_ID => [
            [
                'id' => self::NAME_ID,
                'name' => '姓名'
            ],
            [
                'id' => self::GENDER_ID,
                'name' => '性别'
            ],
            [
                'id' => self::AGE_ID,
                'name' => '年龄'
            ],
            [
                'id' => self::PATIENT_CARD_ID,
                'name' => '诊疗号'
            ],
            [
                'id' => self::MONEY_TIME_ID,
                'name' => '收费/退费时间'
            ],
            [
                'id' => self::CLINIC_ID,
                'name' => '诊室'
            ],
            [
                'id' => self::DOCTOR_NAME_ID,
                'name' => '医生'
            ],
            [
                'id' => self::LAST_REVISITING_ID,
                'name' => '就诊时间'
            ],
            [
                'id' => self::PRE_REALITY_ID,
                'name' => '应收/退金额'
            ],
            [
                'id' => self::REALITY_ID,
                'name' => '实收/退金额'
            ],
            [
                'id' => self::TRADE_TYPE_ID,
                'name' => '交易类型'
            ],
        ],
        self::TREATMENT_ID => [
            [
                'id' => self::NAME_ID,
                'name' => '姓名'
            ],
            [
                'id' => self::GENDER_ID,
                'name' => '性别'
            ],
            [
                'id' => self::AGE_ID,
                'name' => '年龄'
            ],
            [
                'id' => self::PATIENT_CARD_ID,
                'name' => '诊疗号'
            ],
            [
                'id' => self::CLINIC_ID,
                'name' => '诊室'
            ],
            [
                'id' => self::CLINIC_PROJECT_NAME_ID,
                'name' => '最近治疗项目'
            ],
            [
                'id' => self::RECENTLY_CLINIC_ID,
                'name' => '最近治疗时间'
            ],
            [
                'id' => self::TOTAL_NUM,
                'name' => '正常治疗数量'
            ],
            [
                'id' => self::HELP_NUM,
                'name' => '援助治疗数量'
            ],
            [
                'id' => self::RECENTLY_CLINIC_NUM,
                'name' => '正常退费治疗数量'
            ],
            [
                'id' => self::RECENTLY_SURPLUS_NUM,
                'name' => '援助退费治疗数量'
            ],
            [
                'id' => self::OPERATE_NAME_ID,
                'name' => '操作人'
            ],
        ],
        self::GENERAL_ID => [
            [
                'id' =>  self::NAME_ID,
                'name' => '姓名'
            ],
            [
                'id' =>  self:: GENDER_ID,
                'name' => '性别'
            ],
            [
                'id' =>  self::AGE_ID,
                'name' => '年龄'
            ],
            [
                'id' => self::PATIENT_CARD_ID,
                'name' => '诊疗号',
            ],
            [
                'id' => self::MOBILE_ID,
                'name' => '电话'
            ],
            [
                'id' => self::BELONG_ASSISTANT_ID,
                'name' => '医助归属人',
            ],
            [
                'id' => self::BELONG_MEMBER_ID,
                'name' => '客服归属人',
            ],

            [
                'id' => self::CLINIC_ID,
                'name' => '诊室',
            ],
            [
                'id' => self::PATIENT_DISEASES_ID,
                'name' => '病种',
            ],
            [
                'id' => self::PATIENT_CHILD_DISEASES_ID,
                'name' => '二级病种',
            ],
            [
                'id' => self::LAST_REVISITING_ID,
                'name' => '上次到诊时间',
            ],
            [
                'id' => self::NEXT_REVISITING_ID,
                'name' => '下次复诊时间',
            ],
            [
                'id' => self::OUTPATIENT_TYPE_ID,
                'name' => '就诊类型',
            ],
            [
                'id' => self::TAGS_ID,
                'name' => '患者标签',
            ],
            [
                'id' => self::VISITS_ID,
                'name' => '复诊次数',
            ],
            [
                'id' => self::CALLBACK_COUNT_ID,
                'name' => '回访次数',
            ],
            [
                'id' => self::IN_HOSPITAL_COUNT,
                'name' => '住院次数',
            ],
            [
                'id' => self::TREAT_308,
                'name' => '治疗308个数',
            ],
            [
                'id' => self::BUY_308,
                'name' => '308购买个数',
            ],
            [
                'id' => self::SURPLUS_308,
                'name' => '剩余308治疗个数',
            ],
            [
                'id'  => self::KF_LAST_CALLBACK_ID,
                'name' => '客服上次回访时间',
            ],
            [
                'id'  => self::YZ_LAST_CALLBACK_ID,
                'name' => '医助上次回访时间',
            ],
            [
                'id' => self::CITY_NAME_ID,
                'name' => '地区',
            ],
            [
                'id' => self::SOURCE_CHANNEL_ID,
                'name' => '来源',
            ],
            [
                'id' => self::MISSED_DAYS_ID,
                'name' => '未到天数',
            ],
            [
                'id' => self::ALL_MONEY,
                'name' => '消费总额',
            ],
            [
                'id' => self::FAULT_DIAGNOSIS_COUNT,
                'name' => '断诊次数',
            ],
            [
                'id' => self::CALLBACK_TIME,
                'name' => '最近回访时间',
            ],
            [
                'id' => self::CALLBACK_MEMBER_NAME,
                'name' => '最近回访人',
            ],
            [
                'id' => self::CALLBACK_CONTENT,
                'name' => '最近回访内容',
            ],
            [
                'id' => self::REG_TIME,
                'name' => '创建时间',
            ],
        ]
    ];

    // 各模块查询字段
    const MUDEL_LIST_NAME = [
        self::PATIENT_ID => [
            self::NAME_ID => 'a.name',
            self::GENDER_ID => 'a.gender',
            self::AGE_ID => 'a.age',
            self::BELONG_ASSISTANT_ID => 'b.realname as belong_assistant_name',
            self::BELONG_MEMBER_ID => 'a.belong_member_name',
            self::PATIENT_CARD_ID => 'a.patient_card_id',
            self::CLINIC_ID => 'c.name as clinic',
            self::PATIENT_DISEASES_ID => 'h.diseases_name',
            self::CLINIC_PROJECT_NAME_ID => 'group_concat(distinct (CASE WHEN type=1 THEN f.clinic_project_name END)) as clinic_project_name',
            self::CLINIC_TOTAL_NUM => 'sum((CASE WHEN type=1 THEN (f.recently_clinic_num+f.recently_surplus_num) END)) as clinic_total_num',
            self::RECENTLY_CLINIC_NUM => 'sum((CASE WHEN type=1 THEN f.recently_clinic_num END)) as recently_clinic_num',
            self::RECENTLY_SURPLUS_NUM => 'sum((CASE WHEN type=1 THEN f.recently_surplus_num END)) as recently_surplus_num',
            self::SY_CLINIC_TOTAL_NUM => '(f.total_num+f.help_num) as sy_clinic_total_num',
            self::TOTAL_NUM => 'f.total_num',
            self::HELP_NUM => 'f.help_num',
            self::LAST_REVISITING_ID => 'a.last_revisiting_time',
            self::NEXT_REVISITING_ID => 'a.next_revisiting_time',
            self::KF_LAST_CALLBACK_ID => 'a.kf_last_callback_time',
            self::YZ_LAST_CALLBACK_ID => 'a.yz_last_callback_time',
            self::KF_NEXT_CALLBACK_ID => 'a.kf_next_callback_time',
            self::YZ_NEXT_CALLBACK_ID => 'a.yz_next_callback_time',
            self::OUTPATIENT_TYPE_ID => 'd.outpatient_name',
            self::TAGS_ID => 'a.patient_tags_name',
            self::VISITS_ID => 'a.revisiting_count',
            self::MISSED_DAYS_ID => 'a.missed_days',
            self::CALLBACK_COUNT_ID => 'a.callback_count',
            self::CITY_NAME_ID => 'g.title as city_name',
            self::SOURCE_CHANNEL_ID => 'e.source_name',
            self::REMARK_ID => 'a.remark',
        ],
        self::MEDICAL_ID => [
            self::NAME_ID => 'a.name',
            self::GENDER_ID => 'a.gender',
            self::AGE_ID => 'a.age',
            self::PATIENT_CARD_ID => 'a.patient_card_id',
            self::CLINIC_ID => 'b.name as clinic',
            self::LAST_REVISITING_ID => 'a.reg_time',
            self::MOBILE_ID => 'a.mobile',
            self::CITY_NAME_ID => 'e.title as city_name',
            self::PATIENT_DISEASES_ID => 'c.diseases_name',
            self::SOURCE_CHANNEL_ID => 'd.source_name',
            self::REMARK_ID => 'a.remark',
        ],
        self::CALLBACK_ID => [
            self::NAME_ID => 'a.name',
            self::GENDER_ID => 'a.gender',
            self::AGE_ID => 'a.age',
            self::PATIENT_CARD_ID => 'a.patient_card_id',
            self::LAST_REVISITING_ID => 'a.last_revisiting_time',
            self::MISSED_DAYS_ID => 'a.missed_days',
            self::NEXT_REVISITING_ID => 'a.next_revisiting_time',
            self::VISITS_ID => 'a.revisiting_count',
            self::KF_LAST_CALLBACK_ID => 'a.kf_last_callback_time',
            self::YZ_LAST_CALLBACK_ID => 'a.yz_last_callback_time',
            self::KF_NEXT_CALLBACK_ID => 'a.kf_next_callback_time',
            self::YZ_NEXT_CALLBACK_ID => 'a.yz_next_callback_time',
            self::CALLBACK_CONTENT_ID => 'f.content',
            self::TAGS_ID => 'a.patient_tags_name',
            self::OUTPATIENT_TYPE_ID => 'd.outpatient_name',
            self::CITY_NAME_ID => 'h.title as city_name',
            self::SOURCE_CHANNEL_ID => 'e.source_name',
            self::REMARK_ID => 'a.remark',
            self::KF_LAST_CALLBACK_USER_ID => 'a.kf_last_callback_user',
            self::YZ_LAST_CALLBACK_USER_ID => 'a.yz_last_callback_user',
            self::CLINIC_ID => 'c.name as clinic',
            self::BELONG_ASSISTANT_ID => 'b.realname as belong_assistant_name',
            self::BELONG_MEMBER_ID => 'a.belong_member_name',
        ],
        self::CONSUMPTION_ID => [
            self::NAME_ID => 'b.name',
            self::GENDER_ID => 'b.gender',
            self::AGE_ID => 'b.age',
            self::PATIENT_CARD_ID => 'b.patient_card_id',
            self::MONEY_TIME_ID => 'a.created_at',
            self::CLINIC_ID => 'consulting_room',
            self::DOCTOR_NAME_ID => 'a.doctor_name',
            self::LAST_REVISITING_ID => 'a.clinic_time',
            self::PRE_REALITY_ID => 'a.money',
            self::REALITY_ID => 'a.reality_money',
            self::TRADE_TYPE_ID => 'a.trade_type',
        ],
        self::TREATMENT_ID => [
            self::NAME_ID => 'a.name',
            self::GENDER_ID => 'a.gender',
            self::AGE_ID => 'a.age',
            self::PATIENT_CARD_ID => 'a.patient_card_id',
            self::CLINIC_ID => 'b.clinic_name',
            self::CLINIC_PROJECT_NAME_ID => 'b.clinic_project_name',
            self::RECENTLY_CLINIC_ID => 'b.recently_clinic_time',
            self::TOTAL_NUM => 'b.total_num',
            self::HELP_NUM => 'b.help_num',
            self::RECENTLY_CLINIC_NUM => 'b.recently_clinic_num',
            self::RECENTLY_SURPLUS_NUM => 'b.recently_surplus_num',
            self::OPERATE_NAME_ID => 'b.operate_name',
        ],
    ];

    const HEADER_LIST = [
        self::PATIENT_ID => [
            self::NAME_ID => 'name',
            self::GENDER_ID => 'gender',
            self::AGE_ID => 'age',
            self::BELONG_ASSISTANT_ID => 'belong_assistant_name',
            self::BELONG_MEMBER_ID => 'belong_member_name',
            self::PATIENT_CARD_ID => 'patient_card_id',
            self::CLINIC_ID => 'clinic',
            self::PATIENT_DISEASES_ID => 'diseases_name',
            self::CLINIC_PROJECT_NAME_ID => 'clinic_project_name',
            self::CLINIC_TOTAL_NUM => 'clinic_total_num',
            self::RECENTLY_CLINIC_NUM => 'recently_clinic_num',
            self::RECENTLY_SURPLUS_NUM => 'recently_surplus_num',
            self::SY_CLINIC_TOTAL_NUM => 'sy_clinic_total_num',
            self::TOTAL_NUM => 'total_num',
            self::HELP_NUM => 'help_num',
            self::LAST_REVISITING_ID => 'last_revisiting_time',
            self::NEXT_REVISITING_ID => 'next_revisiting_time',
            self::KF_LAST_CALLBACK_ID => 'kf_last_callback_time',
            self::YZ_LAST_CALLBACK_ID => 'yz_last_callback_time',
            self::KF_NEXT_CALLBACK_ID => 'kf_next_callback_time',
            self::YZ_NEXT_CALLBACK_ID => 'yz_next_callback_time',
            self::OUTPATIENT_TYPE_ID => 'outpatient_name',
            self::TAGS_ID => 'patient_tags_name',
            self::VISITS_ID => 'revisiting_count',
            self::MISSED_DAYS_ID => 'missed_days',
            self::CALLBACK_COUNT_ID => 'callback_count',
            self::CITY_NAME_ID => 'city_name',
            self::SOURCE_CHANNEL_ID => 'source_name',
            self::REMARK_ID => 'remark',
        ],
        self::MEDICAL_ID => [
            self::NAME_ID => 'name',
            self::GENDER_ID => 'gender',
            self::AGE_ID => 'age',
            self::PATIENT_CARD_ID => 'patient_card_id',
            self::CLINIC_ID => 'clinic',
            self::LAST_REVISITING_ID => 'reg_time',
            self::MOBILE_ID => 'mobile',
            self::CITY_NAME_ID => 'city_name',
            self::PATIENT_DISEASES_ID => 'diseases_name',
            self::SOURCE_CHANNEL_ID => 'source_name',
            self::REMARK_ID => 'remark',
        ],
        self::CALLBACK_ID => [
            self::NAME_ID => 'name',
            self::GENDER_ID => 'gender',
            self::AGE_ID => 'age',
            self::PATIENT_CARD_ID => 'patient_card_id',
            self::LAST_REVISITING_ID => 'last_revisiting_time',
            self::MISSED_DAYS_ID => 'missed_days',
            self::NEXT_REVISITING_ID => 'next_revisiting_time',
            self::VISITS_ID => 'revisiting_count',
            self::KF_LAST_CALLBACK_ID => 'kf_last_callback_time',
            self::YZ_LAST_CALLBACK_ID => 'yz_last_callback_time',
            self::KF_NEXT_CALLBACK_ID => 'kf_next_callback_time',
            self::YZ_NEXT_CALLBACK_ID => 'yz_next_callback_time',
            self::CALLBACK_CONTENT_ID => 'content',
            self::TAGS_ID => 'patient_tags_name',
            self::OUTPATIENT_TYPE_ID => 'outpatient_name',
            self::CITY_NAME_ID => 'city_name',
            self::SOURCE_CHANNEL_ID => 'source_name',
            self::REMARK_ID => 'remark',
            self::KF_LAST_CALLBACK_USER_ID => 'kf_last_callback_user',
            self::YZ_LAST_CALLBACK_USER_ID => 'yz_last_callback_user',
            self::CLINIC_ID => 'clinic',
            self::BELONG_ASSISTANT_ID => 'belong_assistant_name',
            self::BELONG_MEMBER_ID => 'belong_member_name',
        ],
        self::CONSUMPTION_ID => [
            self::NAME_ID => 'name',
            self::GENDER_ID => 'gender',
            self::AGE_ID => 'age',
            self::PATIENT_CARD_ID => 'patient_card_id',
            self::MONEY_TIME_ID => 'created_at',
            self::CLINIC_ID => 'consulting_room',
            self::DOCTOR_NAME_ID => 'doctor_name',
            self::LAST_REVISITING_ID => 'clinic_time',
            self::PRE_REALITY_ID => 'money',
            self::REALITY_ID => 'reality_money',
            self::TRADE_TYPE_ID => 'trade_type',
        ],
        self::TREATMENT_ID => [
            self::NAME_ID => 'name',
            self::GENDER_ID => 'gender',
            self::AGE_ID => 'age',
            self::PATIENT_CARD_ID => 'patient_card_id',
            self::CLINIC_ID => 'clinic_name',
            self::CLINIC_PROJECT_NAME_ID => 'clinic_project_name',
            self::RECENTLY_CLINIC_ID => 'recently_clinic_time',
            self::TOTAL_NUM => 'total_num',
            self::HELP_NUM => 'help_num',
            self::RECENTLY_CLINIC_NUM => 'recently_clinic_num',
            self::RECENTLY_SURPLUS_NUM => 'recently_surplus_num',
            self::OPERATE_NAME_ID => 'operate_name',
        ],
        self::GENERAL_ID => [
            self::NAME_ID => 'name',
            self:: GENDER_ID => 'gender',
            self::AGE_ID => 'age',
            self::PATIENT_CARD_ID => 'patient_card_id',
            self::MOBILE_ID => 'mobile',
            self::BELONG_ASSISTANT_ID => 'belong_assistant_name',
            self::BELONG_MEMBER_ID=> 'belong_member_name',
            self::CLINIC_ID => 'clinic_name',
            self::PATIENT_DISEASES_ID => 'diseases_name',
            self::PATIENT_CHILD_DISEASES_ID => 'diseases_child_name',
            self::LAST_REVISITING_ID=> 'last_revisiting_time',
            self::NEXT_REVISITING_ID => 'next_revisiting_time',
            self::OUTPATIENT_TYPE_ID => 'outpatient_type_name',
            self::TAGS_ID => 'patient_tags_name',
            self::VISITS_ID => 'revisiting_count',
            self::CALLBACK_COUNT_ID => 'callback_count',
            self::IN_HOSPITAL_COUNT => 'hospital_count',
            self::TREAT_308=> '308_treat',
            self::BUY_308 => '308_buy',
            self::SURPLUS_308 => '308_count',
            self::KF_LAST_CALLBACK_ID => 'kf_last_callback_time',
            self::YZ_LAST_CALLBACK_ID=> 'yz_last_callback_time',
            self::CITY_NAME_ID=> 'city_name',
            self::SOURCE_CHANNEL_ID => 'source_name',
            self::MISSED_DAYS_ID => 'missed_days',
            self::ALL_MONEY => 'money',
            self::FAULT_DIAGNOSIS_COUNT => 'fault_diagnosis_count',
            self::CALLBACK_TIME => 'current_callback_time',
            self::CALLBACK_MEMBER_NAME => 'member_name',
            self::CALLBACK_CONTENT => 'content',
            self::REG_TIME => 'reg_time',
        ]
    ];

    // =============================== 筛选字段对应数据库字段名称 ========================
    // 筛选字段列表,is_choose:1【下拉列表】，2【输入框】，3【时间控件】
    const FIELD_SELECT = [
        self::PATIENT_ID => [// 患者筛选字段
            [
                'id' => self::NAME_ID,
                'is_choose' => 2,
                'name' => '姓名'
            ],
            [
                'id' => self::GENDER_ID,
                'is_choose' => 1,
                'name' => '性别'
            ],
            [
                'id' => self::AGE_ID,
                'is_choose' => 2,
                'name' => '年龄'
            ],
            [
                'id' => self::BELONG_ASSISTANT_ID,
                'is_choose' => 1,
                'name' => '医助归属人'
            ],
            [
                'id' => self::BELONG_MEMBER_ID,
                'is_choose' => 1,
                'name' => '客服归属人'
            ],
            [
                'id' => self::PATIENT_CARD_ID,
                'is_choose' => 2,
                'name' => '诊疗号'
            ],
            [
                'id' => self::CLINIC_ID,
                'is_choose' => 1,
                'name' => '诊室'
            ],
            [
                'id' => self::PATIENT_DISEASES_ID,
                'is_choose' => 1,
                'name' => '病种'
            ],
            [
                'id' => self::CLINIC_PROJECT_NAME_ID,
                'is_choose' => 1,
                'name' => '治疗项目'
            ],
            [
                'id' => self::CLINIC_TOTAL_NUM,
                'is_choose' => 2,
                'name' => '治疗数量（总计）'
            ],
            [
                'id' => self::RECENTLY_SURPLUS_NUM,
                'is_choose' => 2,
                'name' => '治疗数量（援助）'
            ],
            [
                'id' => self::RECENTLY_CLINIC_NUM,
                'is_choose' => 2,
                'name' => '治疗数量（正常）'
            ],
            [
                'id' => self::SY_CLINIC_TOTAL_NUM,
                'is_choose' => 2,
                'name' => '剩余治疗数量（总计）'
            ],
            [
                'id' => self::HELP_NUM,
                'is_choose' => 2,
                'name' => '剩余治疗数量（援助）'
            ],
            [
                'id' => self::TOTAL_NUM,
                'is_choose' => 2,
                'name' => '剩余治疗数量（正常）'
            ],
            [
                'id' => self::RECENTLY_CLINIC_ID,
                'is_choose' => 3,
                'name' => '上次治疗时间'
            ],
            [
                'id' => self::LAST_REVISITING_ID,
                'is_choose' => 3,
                'name' => '上次到诊'
            ],
            [
                'id' => self::NEXT_REVISITING_ID,
                'is_choose' => 3,
                'name' => '下次复诊'
            ],
            [
                'id' => self::YZ_LAST_CALLBACK_ID,
                'is_choose' => 3,
                'name' => '上次回访时间(医助)'
            ],
            [
                'id' => self::KF_LAST_CALLBACK_ID,
                'is_choose' => 3,
                'name' => '上次回访时间(客服)'
            ],
            [
                'id' => self::YZ_NEXT_CALLBACK_ID,
                'is_choose' => 3,
                'name' => '下次回访时间(医助)'
            ],
            [
                'id' => self::KF_NEXT_CALLBACK_ID,
                'is_choose' => 3,
                'name' => '下次回访时间(客服)'
            ],
            [
                'id' => self::OUTPATIENT_TYPE_ID,
                'is_choose' => 1,
                'name' => '就诊类型'
            ],
            [
                'id' => self::TAGS_ID,
                'is_choose' => 1,
                'name' => '患者标签'
            ],
            [
                'id' => self::VISITS_ID,
                'is_choose' => 2,
                'name' => '复诊次数'
            ],
            [
                'id' => self::MISSED_DAYS_ID,
                'is_choose' => 2,
                'name' => '未到诊天数'
            ],
            [
                'id' => self::CALLBACK_COUNT_ID,
                'is_choose' => 2,
                'name' => '回访次数'
            ],
            [
                'id' => self::CITY_NAME_ID,
                'is_choose' => 1,
                'name' => '地区'
            ],
            [
                'id' => self::SOURCE_CHANNEL_ID,
                'is_choose' => 1,
                'name' => '来源'
            ],
        ],
        self::MEDICAL_ID => [// 导医筛选字段
            [
                'id' => self::NAME_ID,
                'is_choose' => 2,
                'name' => '姓名'
            ],
            [
                'id' => self::GENDER_ID,
                'is_choose' => 1,
                'name' => '性别'
            ],
            [
                'id' => self::AGE_ID,
                'is_choose' => 2,
                'name' => '年龄'
            ],
            [
                'id' => self::PATIENT_CARD_ID,
                'is_choose' => 2,
                'name' => '诊疗号'
            ],
            [
                'id' => self::CLINIC_ID,
                'is_choose' => 1,
                'name' => '诊室'
            ],
            [
                'id' => self::LAST_REVISITING_ID,
                'is_choose' => 3,
                'name' => '到诊时间'
            ],
            [
                'id' => self::MOBILE_ID,
                'is_choose' => 2,
                'name' => '电话'
            ],
            [
                'id' => self::CITY_NAME_ID,
                'is_choose' => 1,
                'name' => '地区'
            ],
            [
                'id' => self::PATIENT_DISEASES_ID,
                'is_choose' => 1,
                'name' => '病种'
            ],
            [
                'id' => self::SOURCE_CHANNEL_ID,
                'is_choose' => 1,
                'name' => '来源'
            ],
        ],
        self::CONSUMPTION_ID => [// 消费筛选字段
            [
                'id' => self::NAME_ID,
                'is_choose' => 2,
                'name' => '姓名'
            ],
            [
                'id' => self::GENDER_ID,
                'is_choose' => 1,
                'name' => '性别'
            ],
            [
                'id' => self::AGE_ID,
                'is_choose' => 2,
                'name' => '年龄'
            ],
            [
                'id' => self::PATIENT_CARD_ID,
                'is_choose' => 2,
                'name' => '诊疗号'
            ],
            [
                'id' => self::CLINIC_ID,
                'is_choose' => 1,
                'name' => '诊室'
            ],
            [
                'id' => self::LAST_REVISITING_ID,
                'is_choose' => 3,
                'name' => '就诊时间'
            ],
            [
                'id' => self::MONEY_TIME_ID,
                'is_choose' => 3,
                'name' => '收费/退费时间'
            ],
            [
                'id' => self::DOCTOR_NAME_ID,
                'is_choose' => 2,
                'name' => '医生'
            ],
            [
                'id' => self::PRE_REALITY_ID,
                'is_choose' => 2,
                'name' => '应收/退金额'
            ],
            [
                'id' => self::REALITY_ID,
                'is_choose' => 2,
                'name' => '实收/退金额'
            ],
        ],
        self::TREATMENT_ID => [// 治疗筛选字段
            [
                'id' => self::NAME_ID,
                'is_choose' => 2,
                'name' => '姓名'
            ],
            [
                'id' => self::GENDER_ID,
                'is_choose' => 1,
                'name' => '性别'
            ],
            [
                'id' => self::AGE_ID,
                'is_choose' => 2,
                'name' => '年龄'
            ],
            [
                'id' => self::PATIENT_CARD_ID,
                'is_choose' => 2,
                'name' => '诊疗号'
            ],
            [
                'id' => self::CLINIC_ID,
                'is_choose' => 1,
                'name' => '诊室'
            ],
            [
                'id' => self::CLINIC_PROJECT_NAME_ID,
                'is_choose' => 1,
                'name' => '最近治疗项目'
            ],
            [
                'id' => self::TOTAL_HELP_NUM,
                'is_choose' => 2,
                'name' => '治疗数量(正常+援助)'
            ],
            [
                'id' => self::TOTAL_NUM,
                'is_choose' => 2,
                'name' => '正常治疗数量'
            ],
            [
                'id' => self::HELP_NUM,
                'is_choose' => 2,
                'name' => '援助治疗数量'
            ],
            [
                'id' => self::CLINIC_SURPLUS_NUM,
                'is_choose' => 2,
                'name' => '退费治疗数量(正常+援助)'
            ],
            [
                'id' => self::RECENTLY_CLINIC_NUM,
                'is_choose' => 2,
                'name' => '正常退费治疗数量'
            ],
            [
                'id' => self::RECENTLY_SURPLUS_NUM,
                'is_choose' => 2,
                'name' => '援助退费治疗数量'
            ],
            [
                'id' => self::RECENTLY_CLINIC_ID,
                'is_choose' => 3,
                'name' => '最近治疗时间'
            ],
            [
                'id' => self::OPERATE_NAME_ID,
                'is_choose' => 1,
                'name' => '操作人'
            ],
        ],
        self::CALLBACK_ID => [// 回访筛选字段
            [
                'id' => self::NAME_ID,
                'is_choose' => 2,
                'name' => '姓名'
            ],
            [
                'id' => self::GENDER_ID,
                'is_choose' => 1,
                'name' => '性别'
            ],
            [
                'id' => self::AGE_ID,
                'is_choose' => 2,
                'name' => '年龄'
            ],
            [
                'id' => self::PATIENT_CARD_ID,
                'is_choose' => 2,
                'name' => '诊疗号'
            ],
            [
                'id' => self::LAST_REVISITING_ID,
                'is_choose' => 3,
                'name' => '上次到诊'
            ],
            [
                'id' => self::MISSED_DAYS_ID,
                'is_choose' => 2,
                'name' => '未到诊天数'
            ],
            [
                'id' => self::NEXT_REVISITING_ID,
                'is_choose' => 3,
                'name' => '下次复诊'
            ],
            [
                'id' => self::VISITS_ID,
                'is_choose' => 2,
                'name' => '复诊次数'
            ],
            [
                'id' => self::YZ_LAST_CALLBACK_ID,
                'is_choose' => 3,
                'name' => '上次回访时间(医助)'
            ],
            [
                'id' => self::KF_LAST_CALLBACK_ID,
                'is_choose' => 3,
                'name' => '上次回访时间(客服)'
            ],
            [
                'id' => self::YZ_NEXT_CALLBACK_ID,
                'is_choose' => 3,
                'name' => '下次回访时间(医助)'
            ],
            [
                'id' => self::KF_NEXT_CALLBACK_ID,
                'is_choose' => 3,
                'name' => '下次回访时间(客服)'
            ],
            [
                'id' => self::TAGS_ID,
                'is_choose' => 1,
                'name' => '患者标签'
            ],
            [
                'id' => self::OUTPATIENT_TYPE_ID,
                'is_choose' => 1,
                'name' => '就诊类型'
            ],
            [
                'id' => self::CITY_NAME_ID,
                'is_choose' => 1,
                'name' => '地区'
            ],
            [
                'id' => self::SOURCE_CHANNEL_ID,
                'is_choose' => 1,
                'name' => '来源'
            ],
            [
                'id' => self::CLINIC_ID,
                'is_choose' => 1,
                'name' => '诊室'
            ],
            [
                'id' => self::BELONG_ASSISTANT_ID,
                'is_choose' => 1,
                'name' => '医助归属人'
            ],
            [
                'id' => self::BELONG_MEMBER_ID,
                'is_choose' => 1,
                'name' => '客服归属人'
            ],
            [
                'id' => self::YZ_LAST_CALLBACK_USER_ID,
                'is_choose' => 1,
                'name' => '上次回访人（医助）'
            ],
            [
                'id' => self::KF_LAST_CALLBACK_USER_ID,
                'is_choose' => 1,
                'name' => '上次回访人（客服）'
            ],
        ],
    ];

    const FIELD_LIST = [
        self::PATIENT_ID => [
            self::NAME_ID => 'a.name',
            self::GENDER_ID => 'a.gender',
            self::AGE_ID => 'a.age',
            self::BELONG_ASSISTANT_ID => 'a.belong_assistant_id',
            self::BELONG_MEMBER_ID => 'a.belong_member_id',
            self::PATIENT_CARD_ID => 'a.patient_card_id',
            self::CLINIC_ID => 'a.clinic_id',
            self::PATIENT_DISEASES_ID => 'a.patient_diseases_id',// 以下为追加
            self::CLINIC_PROJECT_NAME_ID => 'f.clinic_project_id',
            self::CLINIC_TOTAL_NUM => '(f.recently_clinic_num+f.recently_surplus_num) as clinic_total_num',
            self::RECENTLY_CLINIC_NUM => 'f.recently_clinic_num',
            self::RECENTLY_SURPLUS_NUM => 'f.recently_surplus_num',
            self::SY_CLINIC_TOTAL_NUM => '(f.total_num+f.help_num) as sy_clinic_total_num',
            self::TOTAL_NUM => 'f.total_num',
            self::HELP_NUM => 'f.help_num',
            self::RECENTLY_CLINIC_ID => 'a.last_clinic_time',// 追加完毕
            self::LAST_REVISITING_ID => 'a.last_revisiting_time',
            self::NEXT_REVISITING_ID => 'a.next_revisiting_time',
            self::YZ_LAST_CALLBACK_ID => 'a.yz_last_callback_time',
            self::KF_LAST_CALLBACK_ID => 'a.kf_last_callback_time',
            self::YZ_NEXT_CALLBACK_ID => 'a.yz_next_callback_time',
            self::KF_NEXT_CALLBACK_ID => 'a.kf_next_callback_time',
            self::OUTPATIENT_TYPE_ID => 'a.outpatient_type_id',
            self::TAGS_ID => 'a.patient_tags_name',
            self::VISITS_ID => 'a.revisiting_count',
            self::MISSED_DAYS_ID => 'a.missed_days',
            self::CALLBACK_COUNT_ID => 'a.callback_count',
            self::CITY_NAME_ID => 'a.city_id',
            self::SOURCE_CHANNEL_ID => 'a.source_channel_id',
        ],
        self::MEDICAL_ID => [
            self::NAME_ID => 'a.name',
            self::GENDER_ID => 'a.gender',
            self::AGE_ID => 'a.age',
            self::PATIENT_CARD_ID => 'a.patient_card_id',
            self::CLINIC_ID => 'a.clinic_id',
            self::LAST_REVISITING_ID => 'a.reg_time',
            self::MOBILE_ID => 'a.mobile',
            self::CITY_NAME_ID => 'a.city_id',
            self::PATIENT_DISEASES_ID => 'a.patient_diseases_id',
            self::SOURCE_CHANNEL_ID => 'a.source_channel_id',
        ],
        self::CALLBACK_ID => [
            self::NAME_ID => 'a.name',
            self::GENDER_ID => 'a.gender',
            self::AGE_ID => 'a.age',
            self::PATIENT_CARD_ID => 'a.patient_card_id',
            self::LAST_REVISITING_ID => 'a.last_revisiting_time',
            self::MISSED_DAYS_ID => 'a.missed_days',
            self::NEXT_REVISITING_ID => 'a.next_revisiting_time',
            self::CALLBACK_COUNT_ID => 'a.callback_count',
            self::YZ_LAST_CALLBACK_ID => 'a.yz_last_callback_time',
            self::KF_LAST_CALLBACK_ID => 'a.kf_last_callback_time',
            self::YZ_NEXT_CALLBACK_ID => 'a.yz_next_callback_time',
            self::KF_NEXT_CALLBACK_ID => 'a.kf_next_callback_time',
            self::TAGS_ID => 'a.patient_tags_name',
            self::OUTPATIENT_TYPE_ID => 'a.outpatient_type_id',
            self::CITY_NAME_ID => 'a.city_id',
            self::SOURCE_CHANNEL_ID => 'a.source_channel_id',
            self::KF_LAST_CALLBACK_USER_ID => 'a.kf_last_callback_user',
            self::YZ_LAST_CALLBACK_USER_ID => 'a.yz_last_callback_user',
            self::CLINIC_ID => 'a.clinic_id',
            self::BELONG_ASSISTANT_ID => 'a.belong_assistant_id',
            self::BELONG_MEMBER_ID => 'a.belong_member_id',
            self::VISITS_ID => 'a.revisiting_count',
        ],
        self::CONSUMPTION_ID => [
            self::NAME_ID => 'b.name',
            self::GENDER_ID => 'b.gender',
            self::AGE_ID => 'b.age',
            self::PATIENT_CARD_ID => 'b.patient_card_id',
            self::MONEY_TIME_ID => 'a.created_at',
            self::CLINIC_ID => 'b.clinic_id',
            self::DOCTOR_NAME_ID => 'a.doctor_name',
            self::LAST_REVISITING_ID => 'a.clinic_time',
            self::PRE_REALITY_ID => 'a.money',
            self::REALITY_ID => 'a.reality_money',
            self::TRADE_TYPE_ID => 'a.trade_type',
        ],
        self::TREATMENT_ID => [
            self::NAME_ID => 'a.name',
            self::GENDER_ID => 'a.gender',
            self::AGE_ID => 'a.age',
            self::PATIENT_CARD_ID => 'a.patient_card_id',
            self::CLINIC_ID => 'b.clinic_id',
            self::CLINIC_PROJECT_NAME_ID => 'b.clinic_project_id',
            self::RECENTLY_CLINIC_ID => 'b.recently_clinic_time',
            self::TOTAL_NUM => 'b.total_num',
            self::HELP_NUM => 'b.help_num',
            self::RECENTLY_CLINIC_NUM => 'b.recently_clinic_num',
            self::RECENTLY_SURPLUS_NUM => 'b.recently_surplus_num',
            self::OPERATE_NAME_ID => 'b.operate_id',
        ],
    ];
}